package implementation;

import model.HasSource;
import model.Operation;
import operand.MyValue;
import operand.Operand;

/**
 * The {@link IntegerAddition} is the subtraction {@link Operation} on the data type {@link Integer}.
 *
 */
public class IntegerSubtraction extends Operation<Integer>{

	/**
	 * Constructor of {@link IntegerSubtraction}.
	 * @param minuend is the minuend.
	 * @param subtrahend is the subtrahend.
	 */
	public IntegerSubtraction(final HasSource<Operand<Integer>> minuend,
			final HasSource<Operand<Integer>> subtrahend) {
		super(minuend, subtrahend);
	}

	@Override
	protected Operand<Integer> calculateTransitive(final MyValue<Integer> firstValue,
			final MyValue<Integer> secondValue) {
		return new MyValue<Integer>(firstValue.getValue() - secondValue.getValue());
	}
	
}
